package com.qf.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.util.Date;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/30 17:49
 */
public class User {
    @JsonProperty("username")//定义生成响应正文该属性的名称
    private String name;
    @JsonIgnore//对象生成响应正文是不显示此属性
    private int age;
//    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)//当属性值为null和""时属性不输出
    private String address;
    @JsonSerialize(using = MySerializer.class)//自定义参数个格式,MySerializer.class格式类的类对象
    private Double salary = 10000.126;

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
